﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WorkerService1
{
    internal class MyService(IHttpClientFactory httpClientFactory, IConfiguration configuration) : BackgroundService
    {
        protected override async Task ExecuteAsync(CancellationToken stoppingToken)
        {

            var client = httpClientFactory.CreateClient("ExampleClient");
            var response = await client.GetAsync("weatherForecast");
            response.EnsureSuccessStatusCode();
            var content = await response.Content.ReadAsStringAsync();

            Console.WriteLine(content);
        }
    }
}
